﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Yawf.Core.Exceptions {
	public class YawfException : Exception {
		private Exception _originalException;
		private Object _dataObject;
		private long _Id;

		public long Id { get { return _Id; } set { _Id = value; } }
		public Exception OriginalException { get { return _originalException; } set { _originalException = value; } }
		public Object DataObject { get { return _dataObject; } set { _dataObject = value; } }

		public YawfException()
			: base() {
		}

		public YawfException(string message)
			: base(message) {
			this.Id = -1;
		}

		public YawfException(long id, string message)
			: base(message) {
			this.Id = id;
		}

		public YawfException(long id, string message, Exception original)
			: base(message) {
			this.Id = id;
			this.OriginalException = original;
		}

		public YawfException(string message, Exception original)
			: base(message) {
			this.Id = -1;
			this.OriginalException = original;
		}

		public override String ToString() {
			String result;

			result = Message;
			if (OriginalException != null) {
				result += ", Orignal Exception:" + OriginalException;
			}

			return result;
		}
	}
}
